<?php 
	
	class user{
		private $name;
		private $email;
		private $username;
		private $password;
		private $is_admin;
		
	
		function __construct($name,$email,$username,$password,$is_admin=0){
			
			$this->setName($name);
			$this->setMail($email);
			$this->setUserName($username);
			$this->setPass($password);
			$this->setAdmin($is_admin);
			$this->register($this);
		}
			
		function __destruct(){
				
		}
		
		public function getName(){
			return $this->name;
		}
		public function setName($name){
			if(is_string($name))
				$this->name=$name;
		}
		
		public function getUserName(){
			return $this->username;
		}
		public function setUserName($username){
				if(is_string($username))
				$this->username=$username;
		}
		public function getMail(){
			return $this->email;
		}
		public function setMail($email){
			if(is_string($email))
				$this->email=$email;
		}
		
		public function getPass(){
			return $this->password;
		}
		public function setPass($password){
			if(is_string($password))
				$this->password=$password;
		}
		public function getAdmin(){
			return $this->is_admin;
		}
		public function setAdmin($is_admin){
			$this->is_admin=$is_admin;
		}
		
		public function register(){
			$query="insert into users values(\"$this->name\",\"$this->email\",\"$this->username\",\"$this->password\",\"$this->is_admin\")";
			$dbrec=db_query($query)
			or pretty_die('problem reading table'.mysql_error());
			echo "You have successfully registered!!!";
		}
		
	}

?>